package com.cs.util;

import javax.servlet.http.HttpSession;

public class UserUtil {
    
    //记录信息为 adminUserName & uid & code & rid
    
    public static void setUserName(HttpSession session,String username){
        session.setAttribute("adminUserName",username);
    }

    public static String getUserName(HttpSession session){
        return (String) session.getAttribute("adminUserName");
    }

    public static void setRoleId(HttpSession session,Integer rId){
        session.setAttribute("rId",rId);
    }

    public static int getRoleId(HttpSession session){
        return (int) session.getAttribute("rId");
    }
    
    public static void setUserId(HttpSession session,Integer uId){
        session.setAttribute("uId",uId);
    }
    
    public static int getUserId(HttpSession session){
        return (int) session.getAttribute("uId");
    }
    
    public static void setCode(HttpSession session,String code){
        session.setAttribute("code",code);
    }
    
    public static String getCode(HttpSession session){
        return (String) session.getAttribute("code");
    }
    
    
}
